

#ifndef   _UCPROFILE_H__
#define   _UCPROFILE_H__

#include "zacarray.h"
#include "zAdAChar.h"
#pragma pack (push, 8)

class UcApProfileStorage;

class UcApProfileManagerReactor 
{
public:
    virtual void currentProfileWillChange(const ZTCHAR *newProfile);
    virtual void currentProfileChanged(const ZTCHAR *newProfile);
    virtual void currentProfileWillBeReset(const ZTCHAR *currentProfile);
    virtual void currentProfileReset(const ZTCHAR *currentProfile);
    virtual void currentProfileWillBeSaved(const ZTCHAR *currentProfile);
    virtual void currentProfileSaved(const ZTCHAR *currentProfile);
    virtual void profileWillReset(const ZTCHAR *profileName);
    virtual void profileReset(const ZTCHAR *profileName);
    virtual void profileWillBeSaved(const ZTCHAR *profileName);
    virtual void profileSaved(const ZTCHAR *profileName);
    virtual ~UcApProfileManagerReactor() {}
};

typedef UcArray<ZTCHAR *> UcApProfileNameArray;

class UcApProfileManager 
{
    public:
		virtual ~UcApProfileManager() { };

        virtual void ProfileRegistryKey(ZTCHAR *& strRegProfileKey,
                                        const ZTCHAR * strProfileName)=0;

        virtual Ucad::ErrorStatus ProfileStorage(UcApProfileStorage*& pStore, 	
                                        const ZTCHAR * strProfileName,
                                        BOOL bCreateIfNotExists = TRUE)=0;
        virtual Ucad::ErrorStatus FixedProfileStorage(UcApProfileStorage*& pStore, 	
                                        BOOL bCreateIfNotExists = TRUE)=0;

        virtual int ProfileListNames(UcApProfileNameArray& nameList)=0;

        virtual Ucad::ErrorStatus ProfileExport(const ZTCHAR * strProfileName,
                                                const ZTCHAR * exportFileName)=0;

        virtual Ucad::ErrorStatus ProfileImport(const ZTCHAR * strProfileName,
                                                const ZTCHAR * importFileName,
                                                const ZTCHAR * profileDescription,
                                                ZSoft::Boolean bImportPathInfo)=0; 

        virtual Ucad::ErrorStatus ProfileDelete(const ZTCHAR * strProfileName)=0;

        virtual Ucad::ErrorStatus ProfileReset(const ZTCHAR * strProfileName)=0;

        virtual Ucad::ErrorStatus ProfileSetCurrent(const ZTCHAR * strProfileName)=0;

        virtual Ucad::ErrorStatus ProfileCopy(const ZTCHAR * newProfileName,
                                              const ZTCHAR * oldProfileName,
                                              const ZTCHAR * newProfileDesc)=0;

        virtual Ucad::ErrorStatus ProfileRename(const ZTCHAR * newProfileName,
                                                const ZTCHAR * oldProfileName,
                                                const ZTCHAR * newProfileDesc)=0;

        virtual void addReactor(UcApProfileManagerReactor* ) = 0;
        virtual void removeReactor(UcApProfileManagerReactor* ) = 0;

};

UcApProfileManager* ucProfileManagerPtr();
#define ucProfileManager ucProfileManagerPtr()
class UcString;
class UcApProfileStorage
{
    public:
        virtual ~UcApProfileStorage() {}
        virtual Ucad::ErrorStatus CreateNode(const ZTCHAR * pszNodePath,
            IUnknown*& pUnknown) = 0;
        virtual Ucad::ErrorStatus GetNode(const ZTCHAR * pszNodePath,
            IUnknown*& pUnknown) = 0;
        virtual Ucad::ErrorStatus ReplaceNode(const ZTCHAR * pszNodePath,
            IUnknown* pUnknown) = 0;
        virtual Ucad::ErrorStatus DeleteNode(const ZTCHAR * pszNodePath) = 0;
        virtual Ucad::ErrorStatus GetStorageFile(UcString& pszFile) = 0;
        virtual Ucad::ErrorStatus Save(void) = 0;
};

#pragma pack (pop)
#endif 
